import config from "@/config";

export default {
	state: {
		dictionary: {},
	},
	getters: {
		getValue: (state) => (key, defaultValue = null) => {
			return state.dictionary[key] ?? defaultValue
		}
	},
	mutations: {
		cache(state, {
			key,
			value = null
		}) {
			state.dictionary[key] = value;
		}
	}
}
